﻿using System;
using BigfootSQL;

namespace YourCompany.Modules.MvcTemplate.Model
{
    public class TimesheetItem : BaseModel
    {
        public int ItemId { get; set; }
        public DateTime ItemDate { get; set; }
        public string Description { get; set; }
        public double Hours { get; set; }
        public int PortalId { get; set; }
        public int UserId { get; set; }

        public override void ExecuteValidation()
        {
            Validate.That(ItemDate, "ItemDate").IsNotMinMaxValue("Invalid date");
            Validate.That(Description, "Description").IsNotEmpty("Description is required");
            Validate.That(Hours, "Hours").IsGreaterThan(0, "Please enter a valid number of hours");
        }
    }
}
